<?php

class Customerfeedback extends MY_Controller
{

    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $act = $this->input->get_post('ajaxdata');
        $result = array('code' => 201, 'message' => '', 'result' => '');
        switch ($act) {
            case 'pwd':
                $this->load->library('c_customerfeedback');
                $sendData['img'] = $this->input->get_post('img');
                $sendData['content'] = $this->input->get_post('content');

                $sendData['password'] = $this->lg_user['password'];
                $sendData['uid'] = $this->lg_user['id'];
                $sendData['enterpriseId'] = $this->lg_user['enterpriseId'];
                $sendData['channelId'] = $this->lg_user['channelId'];
                $sendData['userType'] = $this->lg_user['type'];

                //制造接口请求
                $url = $this->c_customerfeedback->set_call_items($sendData);
                $param = $this->c_customerfeedback->get_call_items();
                $rs = $this->restcurl->post($url, $param);
                if ($rs['ErrorCode'] == 0 && $rs['Success'] == 1 && $rs['ErrorMsg'] == '') {
                    $result['msg'] = '添加成功!';
                }
                break;
            default:
                break;
        }
        echo json_encode($result);
        die;
    }

}
